package com.dmaximaging.fancypants {
	import flash.geom.Rectangle;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.display.StageScaleMode;
	import flash.display.StageAlign;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import com.dmaximaging.fancypants.FancyItems;
	import com.dmaximaging.fancypants.FancyPants;
	
	public class FancyControl {
		private var fancypants:FancyPants;
		
		public function FancyControl( fancypants:FancyPants ){
			this.fancypants = fancypants;
			fancypants.fancyitems.mouseChildren = false;
			fancypants.fancyitems.addEventListener( MouseEvent.MOUSE_DOWN, onMouseDown );
			fancypants.fancyitems.addEventListener( MouseEvent.MOUSE_UP, onMouseUp );
		}
		
		private function onMouseDown( event:MouseEvent ){
			event.target.startDrag();
		}
		
		private function onMouseUp( event:MouseEvent ){
			event.target.stopDrag();			
		}
	}
}